<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ include file="/common/common.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link rel="stylesheet" type="text/css" href="${base}/css/drink.css" />
		<title>${siteName}</title>
		<%@ include file="/common/commonstyle.jsp" %>
		<script type="text/javascript">
			function toShopCar(userId) {
				if("" == userId || "undefined" == typeof(userId)) {
					loginModel()
				} else {
					location.href='${base}/orderFrontCtl/orderinfo'
				}
			}
			
			function addShopCar(waresId) {
				var waresType = $("#waresType").val();
				$.ajax({
					url : "${base}/orderFrontCtl/addShopCar",
					type : "post",
					data:{
						waresId : waresId,
						waresType : waresType
					},
					success: function (result) {
						var resultArray = result.split(",");
						jAlert("购物车共有" + resultArray[0] + "件商品，合计：￥" + resultArray[1] + "温馨提示");
					}
				});
			}
			
			$(function() {
				$("#loginForm").submit(function(){
					var email = $("#email").val();
					var password = $("#password").val();
					if(null == email || "" == email) {
						jAlert("<spring:message code='loginempty' />");
						return false;
					} else if(null == password || "" == password) {
						jAlert("<spring:message code='loginempty' />");
						return false;
					} else {
						return true;
					}
				});
			});
		</script>
	</head>
	
	<body>
		<div class="main">
			<%@ include file="/common/header.jsp" %>
		    <div class="banner"><img src="${base}/images/img_26.jpg" width="919" height="272" alt="这是一张图片" /></div>
		    <div class="dishes">
               	<input type="hidden" id="waresType" value="${waresType}" />
		    	<c:forEach items="${waresList}" var="wares">
	        		<form:form action="${base}/orderFrontCtl/toPersionOrderDish">
	               		<input type="hidden" name="waresType" value="${waresType}" />
	               		<input type="hidden" name="waresId" class="text_number" value="${waresType == 1 ? wares.dishid : wares.comboid}" />
				        <div class="juice">
				            <ul>
				                <li>
				                	<em><img src="${base}${wares.photo }" width="178" height="178" alt="" /></em>
				                </li>
				                <li class="explain">
					                <p>
						                <c:if test="${waresType == 1}">
					                    	${i18n == 'en_US' ? wares.dishenname : wares.dishchname}
						                </c:if>
						                <c:if test="${waresType == 2}">
					                    	${i18n == 'en_US' ? wares.comboenname : wares.combochname}
						                </c:if>
			                    	</p>
					                <c:if test="${waresType == 1}">
		                    			${wares.remark}
					                </c:if>
					                <c:if test="${waresType == 2}">
		                    			${wares.nutritioninfo}
					                </c:if>
				                </li>
				                <li>
				                	<input type="submit" class="btn_join" value="加入购物车" />
				                </li>
				            </ul>
				        </div>
			        </form:form>
		        </c:forEach>
		    	<div class="clear"></div>
		    </div>
			<%@ include file="/common/footer.jsp" %>
		</div>
	</body>
</html>